﻿using System;
using System.Text;
using System.Threading;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
using Demo_G.O.S.E.ServerEngine.Map;
using Demo_G.O.S.E.ServerEngine.Util;
using Demo_G.O.S.E.ServerEngine.Item;
using Demo_G.O.S.E.ServerEngine.Timer;
using Demo_G.O.S.E.ServerEngine.Skill;
using Demo_G.O.S.E.ServerEngine.Guild;
using Demo_G.O.S.E.ServerEngine.Common;
using Demo_G.O.S.E.ServerEngine.Network;

namespace Demo_G.O.S.E.ServerEngine.Creature.General
{
    /// <summary>
    /// 
    /// </summary>
    public class GeneralMobile : BaseCreature
    {
        #region zh-CHS 构造和初始化和清理 | en Constructors and Initializers and Dispose
        /// <summary>
        /// 
        /// </summary>
        public GeneralMobile()
            : base()
        {
            UpdateMobile( UpdateBaseMobileValue.MobileDelta , new GeneralMobileDelta() );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="serial"></param>
        public GeneralMobile( Serial serial )
            : base( serial )
        {
            UpdateMobile( UpdateBaseMobileValue.MobileDelta, new GeneralMobileDelta() );
        }
        #endregion

        #region zh-CHS 人物的GUID | en
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private Serial m_MobileGUID;
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public Serial MobileGUID
        {
            get { return m_MobileGUID; }
            set { m_MobileGUID = value; }
        }
        #endregion

        #region zh-CHS 道具/金币/负重-数量的属性 | en Properties

        #region zh-CHS TotalGold属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物总共拥有的金币数量
        /// </summary>
        private long m_TotalGold = 0;
        #endregion
        /// <summary>
        /// 人物总共的金币数量
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long TotalGold
        {
            get { return m_TotalGold; }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 金币改变时调用
        /// </summary>
        public virtual bool OnTotalGoldChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 金币改变时后调用
        /// </summary>
        public virtual void OnAfterTotalGoldChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 更新全部类型的数量
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateTotalGold( long newValue )
        {
            if ( newValue < 0 )
                return false;

            long oldValue = m_TotalGold;

            if ( OnTotalGoldChange( newValue ) == false )
                return false;
            else
            {
                if ( m_TotalGold > m_MaxGold )
                    m_TotalGold = m_MaxGold;
                else
                    m_TotalGold = newValue;
            }

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateTotalGold(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaTotalGoldUpdate();
                UpdateDelta();
            }

            OnAfterTotalGoldChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS TotalItems属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物总共拥有的道具数量
        /// </summary>
        private long m_TotalItems = 0;
        #endregion
        /// <summary>
        /// 人物总共的道具数量
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long TotalItems
        {
            get { return m_TotalItems; }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 重量改变时调用
        /// </summary>
        public virtual bool OnItemsTotalChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 重量改变后调用
        /// </summary>
        public virtual void OnAfterTotalItemsChange( long oldValue )
        {
        }

        /// <summary>
        /// 道具添加
        /// </summary>
        /// <param name="item"></param>
        protected override void OnAfterAddItem( BaseItem baseItem )
        {
            if ( baseItem.IsVirtualItem == false )
                UpdateTotalItems( m_TotalItems + 1 );
        }

        /// <summary>
        /// 道具移去
        /// </summary>
        /// <param name="item"></param>
        protected override void OnAfterRemoveItem( BaseItem baseItem )
        {
            if ( baseItem.IsVirtualItem == false )
                UpdateTotalItems( m_TotalItems - 1 );
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 更新全部类型的数量
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        private bool UpdateTotalItems( long newValue )
        {
            if ( newValue < 0 )
                return false;

            long oldValue = m_TotalItems;

            if ( OnItemsTotalChange( newValue ) == false )
                return false;
            else
                m_TotalItems = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateTotalGold(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaTotalItemsUpdate();
                UpdateDelta();
            }

            OnAfterTotalItemsChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS TotalWeight属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物总共拥有的负重数量
        /// </summary>
        private long m_TotalWeight = 0;
        #endregion
        /// <summary>
        /// 人物总共的负载数量
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long TotalWeight
        {
            get { return m_TotalWeight; }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 重量改变时调用
        /// </summary>
        public virtual bool OnTotalWeightChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 重量改变后调用
        /// </summary>
        public virtual void OnAfterTotalWeightChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 更新全部类型的数量
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateTotalWeight( long newValue )
        {
            if ( newValue < 0 )
                return false;

            long oldValue = m_TotalWeight;

            if ( OnTotalWeightChange( newValue ) == false )
                return false;
            else
            {
                if ( m_TotalWeight > m_MaxWeight )
                    m_TotalWeight = m_MaxWeight;
                else
                    m_TotalWeight = newValue;
            }

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateTotalGold(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaTotalWeightUpdate();
                UpdateDelta();
            }

            OnAfterTotalWeightChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物总共拥有的负重数量
        /// </summary>
        private long m_MaxWeight = long.MaxValue;
        #endregion
        /// <summary>
        /// 最大的重量
        /// </summary>
        public long MaxWeight
        {
            get { return m_MaxWeight; }
            set { m_MaxWeight = value; }
        }

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物总共拥有的负重数量
        /// </summary>
        private long m_MaxGold = long.MaxValue;
        #endregion
        /// <summary>
        /// 最大的金币
        /// </summary>
        public long MaxGold
        {
            get { return m_MaxGold; }
            set { m_MaxGold = value; }
        }
        #endregion

        #region zh-CHS 人物的状态属性 | en

        #region zh-CHS RawStrength属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的基础力量
        /// </summary>
        private long m_RawStrength;
       #endregion
        /// <summary>
        /// 人物的基础力量
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long RawStrength
        {
            get { return m_RawStrength; }
            set { UpdateRawStrength( value ); }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnRawStrengthChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 人物的基础力量已改变
        /// </summary>
        protected virtual void OnAfterRawStrengthChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateRawStrength( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnRawStrengthChange( newValue ) == false )
                return false;
            else
                m_RawStrength = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateRawStrength(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaRawStrengthUpdate();
                UpdateDelta();
            }

            ComputeStat();

            OnAfterRawStrengthChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS Strength属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的有效力量
        /// </summary>
        private long m_Strength;
        #endregion
        /// <summary>
        /// 人物的有效力量
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long Strength
        {
            get { return m_Strength; }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnStrengthChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterStrengthChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateStrength( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnStrengthChange( newValue ) == false )
                return false;
            else
                m_Strength = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateStrength(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaStrengthUpdate();
                UpdateDelta();
            }

            OnAfterStrengthChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS RawDexterity属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的基础敏捷
        /// </summary>
        private long m_RawDexterity;
        #endregion
        /// <summary>
        /// 人物的基础敏捷
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long RawDexterity
        {
            get { return m_RawDexterity; }
            set { UpdateRawDexterity( value ); }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnRawDexterityChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 人物的基础敏捷已改变
        /// </summary>
        protected virtual void OnAfterRawDexterityChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateRawDexterity( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnRawDexterityChange( newValue ) == false )
                return false;
            else
                m_RawDexterity = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateRawDexterity(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaRawDexterityUpdate();
                UpdateDelta();
            }

            ComputeStat();

            OnAfterRawDexterityChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS Dexterity属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的有效敏捷
        /// </summary>
        private long m_Dexterity;
        #endregion
        /// <summary>
        /// 人物的有效敏捷
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long Dexterity
        {
            get { return m_Dexterity; }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnDexterityChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterDexterityChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateDexterity( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnDexterityChange( newValue ) == false )
                return false;
            else
                m_Dexterity = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateDexterity(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaDexterityUpdate();
                UpdateDelta();
            }

            OnAfterDexterityChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS RawIntellect属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的基础智力
        /// </summary>
        private long m_RawIntellect;
        #endregion
        /// <summary>
        /// 人物的基础智力
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long RawIntellect
        {
            get { return m_RawIntellect; }
            set { UpdateRawIntellect( value ); }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnRawIntellectChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 人物的基础智力已改变
        /// </summary>
        protected virtual void OnAfterRawIntellectChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateRawIntellect( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnRawIntellectChange( newValue ) == false )
                return false;
            else
                m_RawIntellect = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateRawIntellect(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaRawIntellectUpdate();
                UpdateDelta();
            }

            ComputeStat();

            OnAfterRawIntellectChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS Intellect属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的有效智力
        /// </summary>
        private long m_Intellect;
        #endregion
        /// <summary>
        /// 人物的有效智力
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long Intellect
        {
            get { return m_Intellect; }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnIntellectChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterIntellectChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateIntellect( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnIntellectChange( newValue ) == false )
                return false;
            else
                m_Intellect = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateIntellect(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaIntellectUpdate();
                UpdateDelta();
            }

            OnAfterIntellectChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS RawConvergence属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的基础集中
        /// </summary>
        private long m_RawConvergence;
        #endregion
        /// <summary>
        /// 人物的基础集中
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long RawConvergence
        {
            get { return m_RawConvergence; }
            set { UpdateRawConvergence( value ); }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 人物的有效集中已改变
        /// </summary>
        protected virtual bool OnRawConvergenceChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterRawConvergenceChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateRawConvergence( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnRawConvergenceChange( newValue ) == false )
                return false;
            else
                m_RawConvergence = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateRawConvergence(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaRawConvergenceUpdate();
                UpdateDelta();
            }

            ComputeStat();

            OnAfterRawConvergenceChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS Convergence属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的有效集中
        /// </summary>
        private long m_Convergence;
        #endregion
        /// <summary>
        /// 人物的有效集中
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long Convergence
        {
            get { return m_Convergence; }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnConvergenceChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterConvergenceChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateConvergence( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnConvergenceChange( newValue ) == false )
                return false;
            else
                m_Convergence = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateConvergence(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaConvergenceUpdate();
                UpdateDelta();
            }

            OnAfterConvergenceChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS RawCharm属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的基础魅力
        /// </summary>
        private long m_RawCharm;
        #endregion
        /// <summary>
        /// 人物的基础魅力
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long RawCharm
        {
            get { return m_RawCharm; }
            set { UpdateRawCharm( value ); }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 人物的基础感觉已改变
        /// </summary>
        protected virtual bool OnRawCharmChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterRawCharmChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateRawCharm( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnRawCharmChange( newValue ) == false )
                return false;
            else
                m_RawCharm = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateRawCharm(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaRawCharmUpdate();
                UpdateDelta();
            }

            ComputeStat();

            OnAfterRawCharmChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS Charm属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的有效集中
        /// </summary>
        private long m_Charm;
        #endregion
        /// <summary>
        /// 人物的有效魅力
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long Charm
        {
            get { return m_Charm; }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnCharmChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterCharmChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateCharm( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnCharmChange( newValue ) == false )
                return false;
            else
                m_Charm = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateCharm(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaCharmUpdate();
                UpdateDelta();
            }

            OnAfterCharmChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS RawSense属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的基础感觉
        /// </summary>
        private long m_RawSense;
        #endregion
        /// <summary>
        /// 人物的基础感觉
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long RawSense
        {
            get { return m_RawSense; }
            set { UpdateRawSense( value ); }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnRawSenseChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 人物的基础感觉已改变
        /// </summary>
        protected virtual void OnAfterRawSenseChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateRawSense( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnRawSenseChange( newValue ) == false )
                return false;
            else
                m_RawSense = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateRawSense(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaRawSenseUpdate();
                UpdateDelta();
            }

            ComputeStat();

            OnAfterRawSenseChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS Sense属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的有效感觉
        /// </summary>
        private long m_Sense;
        #endregion
        /// <summary>
        /// 人物的有效感觉
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long Sense
        {
            get { return m_Sense; }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnSenseChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterSenseChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateSense( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnSenseChange( newValue ) == false )
                return false;
            else
                m_Sense = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateSense(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaSenseUpdate();
                UpdateDelta();
            }

            OnAfterSenseChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS StatMods属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private Dictionary<long, StatMod> m_StatMods = new Dictionary<long,StatMod>();
        #endregion
        /// <summary>
        /// 当前用户的状态列表
        /// </summary>
        public Dictionary<long, StatMod> StatMods
        {
            get { return m_StatMods; }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="mod"></param>
        public void AddStatMod( Serial serial, StatMod statMod )
        {
            if ( statMod == null )
            {
                Debug.WriteLine( "GeneralMobile.AddStatMod(...) - statMod == null error!" );
                return;
            }

            m_StatMods[serial] = statMod;

            ComputeStat();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public bool RemoveStatMod( Serial serial )
        {
            bool bReturn = m_StatMods.Remove( serial );

            if ( bReturn )
                ComputeStat();

            return bReturn;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public StatMod GetStatMod( Serial serial )
        {
            foreach ( KeyValuePair<long, StatMod> keyValuePair in m_StatMods )
            {
                if ( keyValuePair.Value.Serial == serial )
                    return keyValuePair.Value;
            }

            return null;
        }

        /// <summary>
        /// 完成计算人物力量的数据
        /// </summary>
        /// <param name="dir"></param>
        /// <returns></returns>
        public virtual void ComputeStat()
        {
            long iStrength = m_RawStrength;
            long iDexterity = m_RawDexterity;
            long iIntellect = m_RawIntellect;
            long iConvergence = m_RawConvergence;
            long iCharm = m_RawCharm;
            long iSense = m_RawSense;

            foreach ( KeyValuePair<long, StatMod> keyValuePair in m_StatMods )
            {
                StatMod checkStatMod = keyValuePair.Value;

                switch ( checkStatMod.Type )
                {
                    case StatType.Strength:
                        iStrength += checkStatMod.Offset;
                        break;
                    case StatType.Dexterity:
                        iDexterity += checkStatMod.Offset;
                        break;
                    case StatType.Intellect:
                        iIntellect += checkStatMod.Offset;
                        break;
                    case StatType.Convergence:
                        iConvergence += checkStatMod.Offset;
                        break;
                    case StatType.Charm:
                        iCharm += checkStatMod.Offset;
                        break;
                    case StatType.Sense:
                        iSense += checkStatMod.Offset;
                        break;
                    case StatType.All:
                        iStrength += checkStatMod.Offset;
                        iDexterity += checkStatMod.Offset;
                        iIntellect += checkStatMod.Offset;
                        iConvergence += checkStatMod.Offset;
                        iCharm += checkStatMod.Offset;
                        iSense += checkStatMod.Offset;
                        break;
                }
            }

            long iHitsMax = iStrength * 2;
            long iManaMax = iIntellect * 2;
            long iStaminaMax = iDexterity * 2;

            UpdateStrength( iStrength );
            UpdateDexterity( iDexterity );
            UpdateIntellect( iIntellect );
            UpdateConvergence( iConvergence );
            UpdateCharm( iCharm );
            UpdateSense( iSense );
            UpdateHitsMax( iHitsMax );
            UpdateManaMax( iManaMax );
            UpdateStaminaMax( iStaminaMax );

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.ComputeStat(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaStatUpdate();
                UpdateDelta();
            }

            CheckStatTimers();
        }

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private TimeSlice m_HitsTimer = null;
        /// <summary>
        /// 
        /// </summary>
        private TimeSlice m_ManaTimer = null;
        /// <summary>
        /// 
        /// </summary>
        private TimeSlice m_StaminaTimer = null;
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public virtual void CheckStatTimers()
        {
            if ( Deleted )
                return;

            if ( Hits < HitsMax )
            {
                if ( CanRegenHits )
                {
                    if ( m_HitsTimer == null )
                        m_HitsTimer = new HitsTimer( this );

                    if ( m_HitsTimer.Running == false )
                        m_HitsTimer.Start();
                }
                else if ( m_HitsTimer != null )
                {
                    m_HitsTimer.Stop();
                }
            }
            else
            {
                Hits = HitsMax;
            }

            if ( Stamina < StaminaMax )
            {
                if ( CanRegenStamina )
                {
                    if ( m_StaminaTimer == null )
                        m_StaminaTimer = new StaminaTimer( this );

                    if ( m_StaminaTimer.Running == false )
                        m_StaminaTimer.Start();
                }
                else if ( m_StaminaTimer != null )
                {
                    m_StaminaTimer.Stop();
                }
            }
            else
            {
                Stamina = StaminaMax;
            }

            if ( Mana < ManaMax )
            {
                if ( CanRegenMana )
                {
                    if ( m_ManaTimer == null )
                        m_ManaTimer = new ManaTimer( this );

                    if ( m_ManaTimer.Running == false )
                        m_ManaTimer.Start();
                }
                else if ( m_ManaTimer != null )
                {
                    m_ManaTimer.Stop();
                }
            }
            else
            {
                Mana = ManaMax;
            }
        }
        #endregion

        #endregion

        #region zh-CHS Stamina属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物当前的持久力
        /// </summary>
        private long m_Stamina;
        #endregion
        /// <summary>
        /// 人物当前的持久力
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long Stamina
        {
            get { return m_Stamina; }
            set { UpdateStamina( value ); }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnStaminaChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 人物当前的持久力已改变
        /// </summary>
        protected virtual void OnAfterStaminaChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateStamina( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnStaminaChange( newValue ) == false )
                return false;
            else
                m_Stamina = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateStamina(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaStaminaUpdate();
                UpdateDelta();
            }

            OnAfterStaminaChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS StaminaMax属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物最大的持久力
        /// </summary>
        private long m_StaminaMax = long.MaxValue;
        #endregion
        /// <summary>
        /// 人物最大的持久力
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long StaminaMax
        {
            get { return m_StaminaMax; }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnStaminaMaxChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterStaminaMaxChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateStaminaMax( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnStaminaMaxChange( newValue ) == false )
                return false;
            else
                m_Stamina = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateStaminaMax(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaStaminaMaxUpdate();
                UpdateDelta();
            }

            OnAfterStaminaMaxChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS Hits属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物当前的生命值
        /// </summary>
        private long m_Hits;
        #endregion
        /// <summary>
        /// 人物当前的生命值
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long Hits
        {
            get { return m_Hits; }
            set { UpdateHits( value ); }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnHitsChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 人物当前的生命值已改变
        /// </summary>
        protected virtual void OnAfterHitsChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateHits( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnHitsChange( newValue ) == false )
                return false;
            else
                m_Hits = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateHits(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaHitsUpdate();
                UpdateDelta();
            }

            OnAfterHitsChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS HitsMax属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物最大的持久力
        /// </summary>
        private long m_HitsMax = long.MaxValue;
        #endregion
        /// <summary>
        /// 人物最大的生命值
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long HitsMax
        {
            get { return m_HitsMax; }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnHitsMaxChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterHitsMaxChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateHitsMax( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnHitsMaxChange( newValue ) == false )
                return false;
            else
                m_Hits = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateHitsMax(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaHitsMaxUpdate();
                UpdateDelta();
            }

            OnAfterHitsMaxChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS Mana属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物当前的的魔法值
        /// </summary>
        private long m_Mana;
        #endregion
        /// <summary>
        /// 人物当前的的魔法值
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long Mana
        {
            get { return m_Mana; }
            set { UpdateMana( value ); }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnManaChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 人物当前的的魔法值已改变
        /// </summary>
        protected virtual void OnAfterManaChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateMana( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnManaChange( newValue ) == false )
                return false;
            else
                m_Mana = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateMana(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaManaUpdate();
                UpdateDelta();
            }

            OnAfterManaChange( oldValue );

            return true;
        }

        #endregion

        #endregion

        #region zh-CHS ManaMax属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物最大的持久力
        /// </summary>
        private long m_ManaMax = long.MaxValue;
        #endregion
        /// <summary>
        /// 人物最大的魔法值
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long ManaMax
        {
            get { return m_ManaMax; }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnManaMaxChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterManaMaxChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateManaMax( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnManaMaxChange( newValue ) == false )
                return false;
            else
                m_Mana = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateManaMax(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaManaMaxUpdate();
                UpdateDelta();
            }

            OnAfterManaMaxChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS Level属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 等级
        /// </summary>
        private long m_Level = 1;
        #endregion
        /// <summary>
        ///  人物的等级
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long Level
        {
            get { return m_Level; }
            set { UpdateLevel( value ); }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnLevelChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterLevelChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateLevel( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnLevelChange( newValue ) == false )
                return false;
            else
                m_Level = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateLevel(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaLevelUpdate();
                UpdateDelta();
            }

            ComputeStat();

            OnAfterLevelChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS Experience属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 经验
        /// </summary>
        private long m_Experience;
        #endregion
        /// <summary>
        ///  人物的经验
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long Experience
        {
            get { return m_Experience; }
            set { UpdateExperience( value ); }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnExperienceChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterExperienceChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateExperience( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnExperienceChange( newValue ) == false )
                return false;
            else
                m_Experience = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateExperience(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaExperienceUpdate();
                UpdateDelta();
            }

            OnAfterExperienceChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS SkillPoint属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 技能点
        /// </summary>
        private long m_SkillPoint;
        #endregion
        /// <summary>
        ///  人物的技能点
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long SkillPoint
        {
            get { return m_SkillPoint; }
            set { UpdateSkillPoint( value ); }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnSkillPointChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterSkillPointChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateSkillPoint( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnSkillPointChange( newValue ) == false )
                return false;
            else
                m_SkillPoint = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateSkillPoint(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaSkillPointUpdate();
                UpdateDelta();
            }

            OnAfterSkillPointChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS SpellPoint属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 技能点
        /// </summary>
        private long m_SpellPoint;
        #endregion
        /// <summary>
        ///  人物的技能点
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long SpellPoint
        {
            get { return m_SpellPoint; }
            set { UpdateSpellPoint( value ); }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnSpellPointChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterSpellPointChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateSpellPoint( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnSpellPointChange( newValue ) == false )
                return false;
            else
                m_SpellPoint = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateSpellPoint(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaSpellPointUpdate();
                UpdateDelta();
            }

            OnAfterSpellPointChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS StatusPoint属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 能力点
        /// </summary>
        private long m_StatusPoint;
        #endregion
        /// <summary>
        ///  人物的能力点
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long StatusPoint
        {
            get { return m_StatusPoint; }
            set { UpdateStatusPoint( value ); }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnStatusPointChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterStatusPointChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateStatusPoint( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnStatusPointChange( newValue ) == false )
                return false;
            else
                m_StatusPoint = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateStatusPoint(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaStatusPointUpdate();
                UpdateDelta();
            }

            OnAfterStatusPointChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS Hunger属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 饥饿
        /// </summary>
        private long m_Hunger;
        #endregion
        /// <summary>
        ///  人物的饥饿值
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long Hunger
        {
            get { return m_Hunger; }
            set { UpdateHunger( value ); }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnHungerChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterHungerChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateHunger( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnHungerChange( newValue ) == false )
                return false;
            else
                m_Hunger = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateHunger(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaHungerUpdate();
                UpdateDelta();
            }

            OnAfterHungerChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS Thirst属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 口渴
        /// </summary>
        private long m_Thirst;
        #endregion
        /// <summary>
        /// 人物的口渴值
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long Thirst
        {
            get { return m_Thirst; }
            set { UpdateThirst( value ); }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnThirstChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterThirstChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateThirst( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnThirstChange( newValue ) == false )
                return false;
            else
                m_Thirst = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateThirst(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaThirstUpdate();
                UpdateDelta();
            }

            OnAfterThirstChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS MeleeDamageAbsorb属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 吸收的攻击伤害
        /// </summary>
        private long m_MeleeDamageAbsorb;
        #endregion
        /// <summary>
        /// 吸收的攻击伤害
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long MeleeDamageAbsorb
        {
            get { return m_MeleeDamageAbsorb; }
            set { UpdateMeleeDamageAbsorb( value ); }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnMeleeDamageAbsorbChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterMeleeDamageAbsorbChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateMeleeDamageAbsorb( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnMeleeDamageAbsorbChange( newValue ) == false )
                return false;
            else
                m_MeleeDamageAbsorb = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateMeleeDamageAbsorb(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaMeleeDamageAbsorbUpdate();
                UpdateDelta();
            }

            OnAfterMeleeDamageAbsorbChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS MagicDamageAbsorb属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 吸收的魔法伤害
        /// </summary>
        private long m_MagicDamageAbsorb;
        #endregion
        /// <summary>
        /// 吸收的魔法伤害
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public long MagicDamageAbsorb
        {
            get { return m_MagicDamageAbsorb; }
            set { UpdateMagicDamageAbsorb( value ); }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnMagicDamageAbsorbChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterMagicDamageAbsorbChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateMagicDamageAbsorb( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnMagicDamageAbsorbChange( newValue ) == false )
                return false;
            else
                m_MagicDamageAbsorb = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateMagicDamageAbsorb(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaMagicDamageAbsorbUpdate();
                UpdateDelta();
            }

            OnAfterMagicDamageAbsorbChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS Paralyzed属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物是否麻痹
        /// </summary>
        private bool m_Paralyzed;
        #endregion
        /// <summary>
        /// 人物是否麻痹
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public bool Paralyzed
        {
            get { return m_Paralyzed; }
            set { UpdateParalyzed( value ); }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnParalyzedChange( bool newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterParalyzedChange( bool oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private ParalyzedTimer m_ParaTimer = null;
        #endregion
        /// <summary>
        /// 麻痹人物
        /// </summary>
        /// <param name="duration"></param>
        public void Paralyze( TimeSpan duration )
        {
            if ( m_Paralyzed == false )
            {
                if ( UpdateParalyzed( true ) )
                {
                    m_ParaTimer = new ParalyzedTimer( this, duration );
                    m_ParaTimer.Start();
                }
            }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateParalyzed( bool newValue )
        {
            bool oldValue = newValue;

            if ( OnParalyzedChange( newValue ) == false )
                return false;
            else
                m_Paralyzed = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateParalyzed(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaMagicDamageAbsorbUpdate();
                UpdateDelta();
            }

            OnAfterParalyzedChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS Frozen属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物是否冰冻
        /// </summary>
        private bool m_Frozen;
        #endregion
        /// <summary>
        /// 人物是否冰冻
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public bool Frozen
        {
            get { return m_Frozen; }
            set { UpdateFrozen( value ); }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnFrozenChange( bool newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterFrozenChange( bool oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private FrozenTimer m_FrozenTimer = null;
        #endregion
        /// <summary>
        /// 冰冻人物
        /// </summary>
        /// <param name="duration"></param>
        public void Freeze( TimeSpan duration )
        {
            if ( m_Frozen == false )
            {
                if ( UpdateFrozen( true ) )
                {
                    m_FrozenTimer = new FrozenTimer( this, duration );
                    m_FrozenTimer.Start();
                }
            }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateFrozen( bool newValue )
        {
            bool oldValue = newValue;

            if ( OnFrozenChange( newValue ) == false )
                return false;
            else
                m_Frozen = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateFrozen(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaMagicDamageAbsorbUpdate();
                UpdateDelta();
            }

            OnAfterFrozenChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS CanRegenHits属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物生命是否能再生
        /// </summary>
        private bool m_CanRegenHits = true;
        #endregion
        /// <summary>
        /// 生命是否能再生
        /// </summary>
        public virtual bool CanRegenHits
        {
            get { return ( m_CanRegenHits && Alive ); }
            set { m_CanRegenHits = value; }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        #endregion

        #endregion

        #region zh-CHS CanRegenStamina属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物持久力是否能再生
        /// </summary>
        private bool m_CanRegenStamina = true;
        #endregion
        /// <summary>
        /// 持久力是否能再生
        /// </summary>
        public virtual bool CanRegenStamina
        {
            get { return ( m_CanRegenStamina && Alive ); }
            set { m_CanRegenStamina = value; }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        #endregion

        #endregion

        #region zh-CHS CanRegenMana属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物魔法是否能再生
        /// </summary>
        private bool m_CanRegenMana = true;
        #endregion
        /// <summary>
        /// 魔法是否能再生
        /// </summary>
        public virtual bool CanRegenMana
        {
            get { return ( m_CanRegenMana && Alive ); }
            set { m_CanRegenMana = value; }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        #endregion

        #endregion

        #endregion 

        #region zh-CHS 人物的抗性属性 | en

        #region zh-CHS BasePhysicalResistance属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的全部抗性
        /// </summary>
        private long m_BasePhysicalResistance = 0;
        #endregion
        /// <summary>
        /// 人物的基础自然抵抗
        /// </summary>
        public long BasePhysicalResistance
        {
            get { return m_BasePhysicalResistance; }
            set { UpdateBasePhysicalResistance( value ); }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnBasePhysicalResistanceChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterBasePhysicalResistanceChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateBasePhysicalResistance( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnBasePhysicalResistanceChange( newValue ) == false )
                return false;
            else
                m_RawStrength = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateBasePhysicalResistance(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaBasePhysicalResistanceUpdate();
                UpdateDelta();
            }

            ComputeResistance();

            OnAfterBasePhysicalResistanceChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS PhysicalResistance属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的全部抗性
        /// </summary>
        private long m_PhysicalResistance = 0;
        #endregion
        /// <summary>
        /// 人物的有效自然抵抗
        /// </summary>
        [CommandProperty( AccessLevel.Counselor )]
        public long PhysicalResistance
        {
            get { return m_PhysicalResistance; }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnPhysicalResistanceChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterPhysicalResistanceChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdatePhysicalResistance( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnPhysicalResistanceChange( newValue ) == false )
                return false;
            else
                m_RawStrength = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdatePhysicalResistance(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaPhysicalResistanceUpdate();
                UpdateDelta();
            }

            OnAfterPhysicalResistanceChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS BaseFireResistance属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的全部抗性
        /// </summary>
        private long m_BaseFireResistance = 0;
        #endregion
        /// <summary>
        /// 人物的基础火系抵抗
        /// </summary>
        public long BaseFireResistance
        {
            get { return m_BaseFireResistance; }
            set { UpdateBaseFireResistance( value ); }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnBaseFireResistanceChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterBaseFireResistanceChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateBaseFireResistance( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnBaseFireResistanceChange( newValue ) == false )
                return false;
            else
                m_RawStrength = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateBaseFireResistance(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaBaseFireResistanceUpdate();
                UpdateDelta();
            }

            ComputeResistance();

            OnAfterBaseFireResistanceChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS FireResistance属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的全部抗性
        /// </summary>
        private long m_FireResistance = 0;
        #endregion
        /// <summary>
        /// 人物的有效火系抵抗
        /// </summary>
        [CommandProperty( AccessLevel.Counselor )]
        public long FireResistance
        {
            get { return m_FireResistance; }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnFireResistanceChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterFireResistanceChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateFireResistance( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnFireResistanceChange( newValue ) == false )
                return false;
            else
                m_RawStrength = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateFireResistance(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaFireResistanceUpdate();
                UpdateDelta();
            }

            OnAfterFireResistanceChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS BaseColdResistance属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的全部抗性
        /// </summary>
        private long m_BaseColdResistance = 0;
        #endregion
        /// <summary>
        /// 人物的基础冰系抵抗
        /// </summary>
        public long BaseColdResistance
        {
            get { return m_BaseColdResistance; }
            set { UpdateBaseColdResistance( value ); }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnBaseColdResistanceChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterBaseColdResistanceChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateBaseColdResistance( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnBaseColdResistanceChange( newValue ) == false )
                return false;
            else
                m_RawStrength = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateBaseColdResistance(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaBaseColdResistanceUpdate();
                UpdateDelta();
            }

            ComputeResistance();

            OnAfterBaseColdResistanceChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS ColdResistance属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的全部抗性
        /// </summary>
        private long m_ColdResistance = 0;
        #endregion
        /// <summary>
        /// 人物的有效冰系抵抗
        /// </summary>
        [CommandProperty( AccessLevel.Counselor )]
        public long ColdResistance
        {
            get { return m_ColdResistance; }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnColdResistanceChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterColdResistanceChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateColdResistance( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnColdResistanceChange( newValue ) == false )
                return false;
            else
                m_RawStrength = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateColdResistance(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaColdResistanceUpdate();
                UpdateDelta();
            }

            OnAfterColdResistanceChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS BasePoisonResistance属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的全部抗性
        /// </summary>
        private long m_BasePoisonResistance = 0;
        #endregion
        /// <summary>
        /// 人物的基础毒系抵抗
        /// </summary>
        public long BasePoisonResistance
        {
            get { return m_BasePoisonResistance; }
            set { UpdateBasePoisonResistance( value ); }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnBasePoisonResistanceChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterBasePoisonResistanceChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateBasePoisonResistance( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnBasePoisonResistanceChange( newValue ) == false )
                return false;
            else
                m_RawStrength = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateBasePoisonResistance(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaBasePoisonResistanceUpdate();
                UpdateDelta();
            }

            ComputeResistance();

            OnAfterBasePoisonResistanceChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS PoisonResistance属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的全部抗性
        /// </summary>
        private long m_PoisonResistance = 0;
        #endregion
        /// <summary>
        /// 人物的有效毒系抵抗
        /// </summary>
        [CommandProperty( AccessLevel.Counselor )]
        public long PoisonResistance
        {
            get { return m_PoisonResistance; }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnPoisonResistanceChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterPoisonResistanceChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdatePoisonResistance( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnPoisonResistanceChange( newValue ) == false )
                return false;
            else
                m_RawStrength = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdatePoisonResistance(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaPoisonResistanceUpdate();
                UpdateDelta();
            }

            OnAfterPoisonResistanceChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS BaseEnergyResistance属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的全部抗性
        /// </summary>
        private long m_BaseEnergyResistance = 0;
        #endregion
        /// <summary>
        /// 人物的基础精力抵抗
        /// </summary>
        public long BaseEnergyResistance
        {
            get { return m_BaseEnergyResistance; }
            set { UpdateBaseEnergyResistance( value ); }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnBaseEnergyResistanceChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterBaseEnergyResistanceChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateBaseEnergyResistance( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnBaseEnergyResistanceChange( newValue ) == false )
                return false;
            else
                m_RawStrength = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateBaseEnergyResistance(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaBaseEnergyResistanceUpdate();
                UpdateDelta();
            }

            ComputeResistance();

            OnAfterBaseEnergyResistanceChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS EnergyResistance属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的全部抗性
        /// </summary>
        private long m_EnergyResistance = 0;
        #endregion
        /// <summary>
        /// 人物的有效精力抵抗
        /// </summary>
        [CommandProperty( AccessLevel.Counselor )]
        public long EnergyResistance
        {
            get { return m_EnergyResistance; }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        protected virtual bool OnEnergyResistanceChange( long newValue )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        protected virtual void OnAfterEnergyResistanceChange( long oldValue )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="type"></param>
        /// <param name="delta"></param>
        public bool UpdateEnergyResistance( long newValue )
        {
            if ( newValue == 0 )
                return false;

            long oldValue = newValue;

            if ( OnEnergyResistanceChange( newValue ) == false )
                return false;
            else
                m_RawStrength = newValue;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateEnergyResistance(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaEnergyResistanceUpdate();
                UpdateDelta();
            }

            OnAfterEnergyResistanceChange( oldValue );

            return true;
        }
        #endregion

        #endregion

        #region zh-CHS MinResistance属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的全部抗性
        /// </summary>
        private long m_MinResistance = 0;
        #endregion
        /// <summary>
        /// 给出人物最小的抗性
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public long MinResistance
        {
            get { return m_MinResistance; }
            set
            {
                if ( m_MinResistance != value && value < MaxResistance )
                {
                    m_MinResistance = value;

                    ComputeResistance();
                }
            }
        }

        #endregion

        #region zh-CHS MaxResistance属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的全部抗性
        /// </summary>
        private long m_MaxResistance = long.MaxValue;
        #endregion
        /// <summary>
        /// 给出人物最大的抗性
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public long MaxResistance
        {
            get
            {
                if ( Player ) // 如果是玩家的话给出值
                    return PlayerMaxResistance;

                return m_MaxResistance;
            }
            set
            {
                if ( m_MaxResistance != value && value > MinResistance )
                {
                    m_MaxResistance = value;

                    ComputeResistance();
                }
            }
        }

        #endregion

        #region zh-CHS ResistanceMods属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物抗性的模块列表
        /// </summary>
        private Dictionary<long, ResistanceMod> m_ResistMods = new Dictionary<long, ResistanceMod>();
        #endregion
        /// <summary>
        /// 人物抗性的模块列表
        /// </summary>
        public Dictionary<long, ResistanceMod> ResistanceMods
        {
            get { return m_ResistMods; }
            set { m_ResistMods = value; }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 添加抗性的模块
        /// </summary>
        /// <param name="toAdd"></param>
        public virtual void AddResistanceMod( Serial serial, ResistanceMod resistanceMod )
        {
            if ( serial == null || resistanceMod == null )
            {
                Debug.WriteLine( "GeneralMobile.AddResistanceMod(...) - serial == null || resistanceMod == null error!" );
                return;
            }

            m_ResistMods[serial] = resistanceMod;

            ComputeResistance();
        }

        /// <summary>
        /// 移去抗性的模块
        /// </summary>
        /// <param name="toRemove"></param>
        public virtual bool RemoveResistanceMod( Serial serial )
        {
            bool bReturn = m_ResistMods.Remove( serial );

            if ( bReturn )
                ComputeResistance();

            return bReturn;
        }

        /// <summary>
        /// 移去抗性的模块
        /// </summary>
        /// <param name="toRemove"></param>
        public virtual ResistanceMod GetResistanceMod( Serial serial )
        {
            foreach ( KeyValuePair<long, ResistanceMod> keyValuePair in m_ResistMods )
            {
                if ( keyValuePair.Value.Serial == serial )
                    return keyValuePair.Value;
            }

            return null;
        }

        /// <summary>
        /// 更新(初始化)人物的抗性,完成所有抗性的计算
        /// </summary>
        public virtual void ComputeResistance()
        {
            // 初始化抗性
            long iPhysicalResistance = 0;
            long iFireResistance = 0;
            long iColdResistance = 0;
            long iPoisonResistance = 0;
            long iEnergyResistance = 0;

            iPhysicalResistance += m_BasePhysicalResistance;
            iFireResistance += m_BaseFireResistance;
            iColdResistance += m_BaseColdResistance;
            iPoisonResistance += m_BasePoisonResistance;
            iEnergyResistance += m_BaseEnergyResistance;

            for ( int iIndex = 0; iIndex < m_ResistMods.Count; ++iIndex )
            {
                ResistanceMod l_ResistanceMod = m_ResistMods[iIndex];

                switch ( l_ResistanceMod.Type)
                {
                    case ResistanceType.Physical:
                        iPhysicalResistance += l_ResistanceMod.Offset;
                        break;
                    case ResistanceType.Fire:
                        iFireResistance += l_ResistanceMod.Offset;
                        break;
                    case ResistanceType.Cold:
                        iColdResistance += l_ResistanceMod.Offset;
                        break;
                    case ResistanceType.Poison:
                        iPoisonResistance += l_ResistanceMod.Offset;
                        break;
                    case ResistanceType.Energy:
                        iEnergyResistance += l_ResistanceMod.Offset;
                        break;
                    case ResistanceType.All:
                        iPhysicalResistance += l_ResistanceMod.Offset;
                        iFireResistance += l_ResistanceMod.Offset;
                        iColdResistance += l_ResistanceMod.Offset;
                        iPoisonResistance += l_ResistanceMod.Offset;
                        iEnergyResistance += l_ResistanceMod.Offset;
                        break;
                    default:
                        break;
                }
            }

            foreach ( BaseItem baseItem in ItemsToArray() )
            {
                GeneralItem generalItem = baseItem as GeneralItem;

                // 检查是否有冲突
                //if ( generalItem.OnCheckPropertyConfliction( this ) == true )
                //    continue;

                iPhysicalResistance += generalItem.PhysicalResistance;
                iFireResistance += generalItem.FireResistance;
                iColdResistance += generalItem.ColdResistance;
                iPoisonResistance += generalItem.PoisonResistance;
                iEnergyResistance += generalItem.EnergyResistance;
            }

            if ( m_PhysicalResistance > MaxResistance )
                iPhysicalResistance = MaxResistance;
            else if ( m_PhysicalResistance < MinResistance )
                iPhysicalResistance = MinResistance;

            if ( m_FireResistance > MaxResistance )
                iFireResistance = MaxResistance;
            else if ( m_FireResistance < MinResistance )
                iFireResistance = MinResistance;

            if ( m_ColdResistance > MaxResistance )
                iColdResistance = MaxResistance;
            else if ( m_ColdResistance < MinResistance )
                iColdResistance = MinResistance;

            if ( m_PoisonResistance > MaxResistance )
                iPoisonResistance = MaxResistance;
            else if ( m_PoisonResistance < MinResistance )
                iPoisonResistance = MinResistance;

            if ( m_EnergyResistance > MaxResistance )
                iEnergyResistance = MaxResistance;
            else if ( m_EnergyResistance < MinResistance )
                iEnergyResistance = MinResistance;

            UpdatePhysicalResistance( iPhysicalResistance );
            UpdateFireResistance( iFireResistance );
            UpdateColdResistance( iColdResistance );
            UpdatePoisonResistance( iPoisonResistance );
            UpdateEnergyResistance( iEnergyResistance );

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.ComputeResistance(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaResistanceUpdate();
                UpdateDelta();
            }
        }
        #endregion

        #endregion

        #endregion

        #region zh-CHS 人物的动作属性 | en

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 下一次的攻击时间
        /// </summary>
        private DateTime m_NextCombatTime;
        #endregion
        /// <summary>
        /// 下一次的攻击时间
        /// </summary>
        public DateTime NextCombatTime
        {
            get { return m_NextCombatTime; }
            set { m_NextCombatTime = value; }
        }

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 下一次的施法时间
        /// </summary>
        private DateTime m_NextSkillTime;
        #endregion
        /// <summary>
        /// 下一次的技能时间
        /// </summary>
        public DateTime NextSkillTime
        {
            get { return m_NextSkillTime; }
            set { m_NextSkillTime = value; }
        }

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 下一个释放魔法的时间
        /// </summary>
        private DateTime m_NextSpellTime;
        #endregion
        /// <summary>
        /// 下一次魔法的时间
        /// </summary>
        public DateTime NextSpellTime
        {
            get { return m_NextSpellTime; }
            set { m_NextSpellTime = value; }
        }

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 下一次动作的时间
        /// </summary>
        private DateTime m_NextActionTime;
        #endregion
        /// <summary>
        /// 下一次动作的时间
        /// </summary>
        public DateTime NextActionTime
        {
            get { return m_NextActionTime; }
            set { m_NextActionTime = value; }
        }

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 下一次动作的消息
        /// </summary>
        private DateTime m_NextActionMessage;
        #endregion
        /// <summary>
        /// 下一次动作消息的时间
        /// </summary>
        public DateTime NextActionMessage
        {
            get { return m_NextActionMessage; }
            set { m_NextActionMessage = value; }
        }

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 动作消息的延迟
        /// </summary>
        private static TimeSpan m_ActionMessageDelay = TimeSpan.FromSeconds( 0.125 );
        #endregion
        /// <summary>
        /// 动作消息的延迟
        /// </summary>
        public static TimeSpan ActionMessageDelay
        {
            get { return m_ActionMessageDelay; }
            set { m_ActionMessageDelay = value; }
        }

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物最后移动的时间
        /// </summary>
        private DateTime m_LastMoveTime;
        #endregion
        /// <summary>
        /// 人物最后移动的时间
        /// </summary>
        public DateTime LastMoveTime
        {
            get { return m_LastMoveTime; }
            set { m_LastMoveTime = value; }
        }

        #region zh-CHS Combatant属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物攻击的目标
        /// </summary>
        private BaseCreature m_Combatant;
        #endregion
        /// <summary>
        /// 人物攻击的目标
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public virtual BaseCreature Combatant
        {
            get { return m_Combatant; }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 检查攻击
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public virtual bool OnCheckAttack( BaseCreature baseMobile )
        {
            return true;
        }

        /// <summary>
        /// 
        /// </summary>
        public virtual bool OnUpdateCombatant( BaseCreature newCombatantMobile )
        {
            return true;
        }

        /// <summary>
        /// 战斗改变
        /// </summary>
        public virtual void OnAfterUpdateCombatant( BaseCreature oldCombatantMobile )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="baseMobile"></param>
        public bool UpdateCombatant( BaseCreature newCombatantMobile )
        {
            if ( newCombatantMobile == null )
                return false;

            BaseCreature oldCombatantMobile = m_Combatant;

            if ( OnUpdateCombatant( newCombatantMobile ) == false )
                return false;
            else
                m_Combatant = newCombatantMobile;

            GeneralMobileDelta l_MobileDelta = base.MobileDelta as GeneralMobileDelta;
            if ( l_MobileDelta == null )
                Debug.WriteLine( "GeneralMobile.UpdateCombatant(...) - l_MobileDelta == null warning!" );
            else
            {
                l_MobileDelta.DeltaCombatantUpdate();
                UpdateDelta();
            }

            OnAfterUpdateCombatant( oldCombatantMobile );

            return true;
        }

        /// <summary>
        /// 攻击
        /// </summary>
        /// <param name="m"></param>
        public virtual void Attack( BaseCreature baseMobile )
        {
            if ( OnCheckAttack( baseMobile ) )
                UpdateCombatant( baseMobile );
        }
        #endregion

        #endregion

        #endregion

        #region zh-CHS 攻击人物的列表属性 | en

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 攻击的信息 (里面的是攻击我的人物的列表)
        /// </summary>
        private List<AggressorInfo> m_Aggressors = new List<AggressorInfo>();
        /// <summary>
        /// 
        /// </summary>
        private object m_LockAggressors = new object();
        #endregion
        /// <summary>
        /// 攻击的信息 (里面的是攻击我的人物的列表)
        /// </summary>
        public List<AggressorInfo> Aggressors
        {
            get { return m_Aggressors; }
        }

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 攻击的信息 (里面的是我攻击的人物的列表)
        /// </summary>
        private List<AggressorInfo> m_Aggressed = new List<AggressorInfo>();
        /// <summary>
        /// 
        /// </summary>
        private object m_LockAggressed = new object();
        #endregion
        /// <summary>
        /// 攻击的信息 (里面的是我攻击的人物的列表)
        /// </summary>
        public List<AggressorInfo> Aggressed
        {
            get { return m_Aggressed; }
        }

        #region zh-CHS 保护方法 | en Protected Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="aggressorInfo"></param>
        protected void OnAggressorsRemove( AggressorInfo removeAggressorsInfo )
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="aggressorInfo"></param>
        protected void OnAggressedRemove( AggressorInfo removeAggressorsInfo )
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="aggressorInfo"></param>
        protected void OnAggressorsAdd( AggressorInfo addAggressorsInfo )
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="aggressorInfo"></param>
        protected void OnAggressedAdd( AggressorInfo addAggressorsInfo )
        {
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private TimeSlice m_ExpireAggrTimer = null;
        #endregion
        /// <summary>
        /// 开始更新攻击者与防御者的信息列表
        /// </summary>
        internal void UpdateAggrExpire()
        {
            if ( Deleted || ( m_Aggressors.Count <= 0 && m_Aggressed.Count <= 0 ) )
            {
                StopAggrExpire();
            }
            else 
            {
                if ( m_ExpireAggrTimer == null )
                    m_ExpireAggrTimer = new ExpireAggressorsTimer( this );

                if ( m_ExpireAggrTimer.Running == false )
                    m_ExpireAggrTimer.Start();
            }
        }

        /// <summary>
        /// 停止更新攻击者与防御者的信息列表
        /// </summary>
        internal void StopAggrExpire()
        {
            if ( m_ExpireAggrTimer != null )
                m_ExpireAggrTimer.Stop();
        }

        /// <summary>
        /// 检查更新攻击者与防御者的信息列表
        /// </summary>
        internal void CheckAggrExpire()
        {
            Monitor.Enter( m_LockAggressors );
            {
                foreach ( AggressorInfo aggressorInfo in m_Aggressors )
                {
                    if ( aggressorInfo.Expired )
                    {
                        GeneralMobile attacker = aggressorInfo.Attacker as GeneralMobile;
                        if ( attacker != null )
                            attacker.RemoveAggressed( this );

                        m_Aggressors.Remove( aggressorInfo );
                        OnAggressorsRemove( aggressorInfo );

                        aggressorInfo.Release();
                    }
                }
            }
            Monitor.Exit( m_LockAggressors );

            Monitor.Enter( m_LockAggressed );
            {
                foreach ( AggressorInfo aggressorInfo in m_Aggressed )
                {
                    if ( aggressorInfo.Expired )
                    {
                        GeneralMobile defender = aggressorInfo.Defender as GeneralMobile;
                        if ( defender != null )
                            defender.RemoveAggressor( this );

                        m_Aggressed.Remove( aggressorInfo );
                        OnAggressedRemove( aggressorInfo );

                        aggressorInfo.Release();
                    }
                }
            }
            Monitor.Exit( m_LockAggressed );

            UpdateAggrExpire();
        }

        /// <summary>
        /// 移去我攻击人物的信息列表里面的攻击者
        /// </summary>
        /// <param name="aggressor"></param>
        public void RemoveAggressor( BaseCreature aggressor )
        {
            if ( Deleted )
                return;

            Monitor.Enter( m_LockAggressors );
            {
                foreach ( AggressorInfo aggressorInfo in m_Aggressors )
                {
                    if ( aggressorInfo.Attacker == aggressor )
                    {
                        m_Aggressors.Remove( aggressorInfo );
                        OnAggressorsRemove( aggressorInfo );

                        aggressorInfo.Release();

                        break;
                    }
                }
            }
            Monitor.Exit( m_LockAggressors );

            UpdateAggrExpire();
        }

        /// <summary>
        /// 移去攻击我人物的信息列表里面的防御者
        /// </summary>
        /// <param name="aggressed"></param>
        public void RemoveAggressed( BaseCreature aggressed )
        {
            if ( Deleted )
                return;

            Monitor.Enter( m_LockAggressed );
            {
                foreach ( AggressorInfo aggressorInfo in m_Aggressed )
                {
                    if ( aggressorInfo.Defender == aggressed )
                    {
                        m_Aggressed.Remove( aggressorInfo );
                        OnAggressedRemove( aggressorInfo );

                        aggressorInfo.Release();

                        break;
                    }
                }
            }
            Monitor.Exit( m_LockAggressed );

            UpdateAggrExpire();
        }

        /// <summary>
        /// 添加攻击者与防御者的信息列表
        /// </summary>
        /// <param name="aggressor">攻击者</param>
        public virtual void AggressiveAction( GeneralMobile aggressorMobile )
        {
            if ( aggressorMobile == this )
                return;

            Monitor.Enter( m_LockAggressors );
            {
                bool addAggressor = true;

                foreach ( AggressorInfo aggressorInfo in m_Aggressors )
                {
                    if ( aggressorInfo.Attacker == aggressorMobile )
                    {
                        aggressorInfo.Refresh();
                        addAggressor = false;

                        break;
                    }
                }

                if ( addAggressor )
                {
                    AggressorInfo l_AggressorInfo = AggressorInfo.Instance( aggressorMobile, this );

                    OnAggressorsAdd( l_AggressorInfo );
                    m_Aggressors.Add( l_AggressorInfo );
                }
            }
            Monitor.Exit( m_LockAggressors );

            Monitor.Enter( aggressorMobile.m_LockAggressed );
            {
                bool addAggressed = true;

                foreach ( AggressorInfo aggressorInfo in aggressorMobile.m_Aggressed )
                {
                    if ( aggressorInfo.Defender == this )
                    {
                        aggressorInfo.Refresh();
                        addAggressed = false;

                        break;
                    }
                }

                if ( addAggressed )
                {
                    AggressorInfo l_AggressorInfo = AggressorInfo.Instance( aggressorMobile, this );

                    OnAggressedAdd( l_AggressorInfo );
                    aggressorMobile.m_Aggressed.Add( l_AggressorInfo );
                }
            }
            Monitor.Exit( aggressorMobile.m_LockAggressed );

            UpdateAggrExpire();
        }
        #endregion

        #endregion

        #region zh-CHS 共有静态属性 | en Public Static Properties

        #region zh-CHS 人物的抗性 | en

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 最大的抗性数值
        /// </summary>
        private static int s_MaxPlayerResistance = 70;
        #endregion
        /// <summary>
        /// 玩家最大的抗性数值
        /// </summary>
        public static int PlayerMaxResistance
        {
            get { return s_MaxPlayerResistance; }
            set { s_MaxPlayerResistance = value; }
        }

        #endregion

        #region zh-CHS 人物的再生速率 | en

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 缺省的生命再生速率
        /// </summary>
        private static TimeSpan s_DefaultHitsRate = TimeSpan.FromSeconds( 1.0 );
        #endregion
        /// <summary>
        /// 缺省的生命再生速率
        /// </summary>
        public static TimeSpan DefaultHitsRate
        {
            get { return s_DefaultHitsRate; }
            set { s_DefaultHitsRate = value; }
        }

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 缺省的生命再生速率委托
        /// </summary>
        private static RegenRateHandler s_HitsRegenRate;
        #endregion
        /// <summary>
        /// 缺省的生命再生速率委托
        /// </summary>
        public static RegenRateHandler HitsRegenRateHandler
        {
            get { return s_HitsRegenRate; }
            set { s_HitsRegenRate = value; }
        }

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 缺省的魔法再生速率
        /// </summary>
        private static TimeSpan s_DefaultManaRate = TimeSpan.FromSeconds( 1.0 );
        #endregion
        /// <summary>
        /// 缺省的魔法再生速率
        /// </summary>
        public static TimeSpan DefaultManaRate
        {
            get { return s_DefaultManaRate; }
            set { s_DefaultManaRate = value; }
        }

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 缺省的魔法再生速率委托
        /// </summary>
        private static RegenRateHandler s_ManaRegenRate;
        #endregion
        /// <summary>
        /// 缺省的魔法再生速率委托
        /// </summary>
        public static RegenRateHandler ManaRegenRateHandler
        {
            get { return s_ManaRegenRate; }
            set { s_ManaRegenRate = value; }
        }

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 缺省的持久力再生速率
        /// </summary>
        private static TimeSpan s_DefaultStaminaRate = TimeSpan.FromSeconds( 1.0 );
        #endregion
        /// <summary>
        /// 缺省的持久力再生速率
        /// </summary>
        public static TimeSpan DefaultStaminaRate
        {
            get { return s_DefaultStaminaRate; }
            set { s_DefaultStaminaRate = value; }
        }

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 缺省的持久力再生速率委托
        /// </summary>
        private static RegenRateHandler s_StaminaRegenRate;
        #endregion
        /// <summary>
        /// 缺省的持久力再生速率委托
        /// </summary>
        public static RegenRateHandler StaminaRegenRateHandler
        {
            get { return s_StaminaRegenRate; }
            set { s_StaminaRegenRate = value; }
        }

        #endregion

        #region zh-CHS 检查技能是否可用的委托 | en

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 是否允许增加有益的状态
        /// </summary>
        private static AllowBeneficialHandler s_AllowBeneficialHandler;
        #endregion
        /// <summary>
        /// 是否允许增加有益的状态
        /// </summary>
        public static AllowBeneficialHandler AllowBeneficialHandler
        {
            get { return s_AllowBeneficialHandler; }
            set { s_AllowBeneficialHandler = value; }
        }

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 是否允许增加伤害的状态
        /// </summary>
        private static AllowHarmfulHandler s_AllowHarmfulHandler;
        #endregion
        /// <summary>
        /// 是否允许增加伤害的状态
        /// </summary>
        public static AllowHarmfulHandler AllowHarmfulHandler
        {
            get { return s_AllowHarmfulHandler; }
            set { s_AllowHarmfulHandler = value; }
        }

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 是否允许对目标使用某种的技能(有最大和最小的伤害)
        /// </summary>
        private static SkillCheckTargetHandler s_SkillCheckTargetHandler;
        #endregion
        /// <summary>
        /// 是否允许对目标使用某种的技能(有最大和最小的伤害)
        /// </summary>
        public static SkillCheckTargetHandler SkillCheckTargetHandler
        {
            get { return s_SkillCheckTargetHandler; }
            set { s_SkillCheckTargetHandler = value; }
        }

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 是否允许对目标位置使用某种的技能(有最大和最小的伤害)
        /// </summary>
        private static SkillCheckLocationHandler s_SkillCheckLocationHandler;
        #endregion
        /// <summary>
        /// 是否允许对目标位置使用某种的技能(有最大和最小的伤害)
        /// </summary>
        public static SkillCheckLocationHandler SkillCheckLocationHandler
        {
            get { return s_SkillCheckLocationHandler; }
            set { s_SkillCheckLocationHandler = value; }
        }

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 是否允许对目标直接使用某种的技能(有一定的机率会失败)
        /// </summary>
        private static SkillCheckDirectTargetHandler s_SkillCheckDirectTargetHandler;
        #endregion
        /// <summary>
        /// 是否允许对目标直接使用某种的技能(有一定的机率会失败)
        /// </summary>
        public static SkillCheckDirectTargetHandler SkillCheckDirectTargetHandler
        {
            get { return s_SkillCheckDirectTargetHandler; }
            set { s_SkillCheckDirectTargetHandler = value; }
        }

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 是否允许对目标位置直接使用某种的技能(有一定的机率会失败)
        /// </summary>
        private static SkillCheckDirectLocationHandler s_SkillCheckDirectLocationHandler;
        #endregion
        /// <summary>
        /// 是否允许对目标位置直接使用某种的技能(有一定的机率会失败)
        /// </summary>
        public static SkillCheckDirectLocationHandler SkillCheckDirectLocationHandler
        {
            get { return s_SkillCheckDirectLocationHandler; }
            set { s_SkillCheckDirectLocationHandler = value; }
        }

        #endregion

        #endregion

        #region zh-CHS 共有静态方法 | en Public Static Methods

        #region zh-CHS 人物的再生速率方法 | en
        /// <summary>
        /// 给出生命再生速率
        /// </summary>
        /// <param name="baseMobile"></param>
        /// <returns></returns>
        public static TimeSpan GetHitsRegenRate( BaseCreature baseMobile )
        {
            if ( s_HitsRegenRate == null )
                return s_DefaultHitsRate;
            else
                return s_HitsRegenRate( baseMobile );
        }

        /// <summary>
        /// 给出持久力再生速率
        /// </summary>
        /// <param name="baseMobile"></param>
        /// <returns></returns>
        public static TimeSpan GetStamRegenRate( BaseCreature baseMobile )
        {
            if ( s_StaminaRegenRate == null )
                return s_DefaultStaminaRate;
            else
                return s_StaminaRegenRate( baseMobile );
        }

        /// <summary>
        /// 给出魔法再生速率
        /// </summary>
        /// <param name="baseMobile"></param>
        /// <returns></returns>
        public static TimeSpan GetManaRegenRate( BaseCreature baseMobile )
        {
            if ( s_ManaRegenRate == null )
                return s_DefaultManaRate;
            else
                return s_ManaRegenRate( baseMobile );
        }
        #endregion

        #endregion

        #region zh-CHS 方法覆盖 | en Override Methods
        /// <summary>
        /// 在删除
        /// </summary>
        protected override void OnBeforeDelete()
        {
            //if( m_Spawner != null )
            //{
            //    m_Spawner.Remove( this );
            //    m_Spawner = null;
            //}
        }

        /// <summary>
        /// 删除之后
        /// </summary>
        protected override void OnAfterDelete()
        {
            StopAggrExpire();

            CheckAggrExpire();

            //if ( m_PoisonTimer != null )
            //    m_PoisonTimer.Stop();

            if ( m_HitsTimer != null )
                m_HitsTimer.Stop();

            if ( m_StaminaTimer != null )
                m_StaminaTimer.Stop();

            if ( m_ManaTimer != null )
                m_ManaTimer.Stop();

            //if ( m_CombatTimer != null )
            //    m_CombatTimer.Stop();

            //if ( m_ExpireCombatant != null )
            //    m_ExpireCombatant.Stop();

            //if ( m_LogoutTimer != null )
            //    m_LogoutTimer.Stop();

            //if ( m_ExpireCriminal != null )
            //    m_ExpireCriminal.Stop();

            //if ( m_WarmodeTimer != null )
            //    m_WarmodeTimer.Stop();

            //if ( m_ParaTimer != null )
            //    m_ParaTimer.Stop();

            //if ( m_FrozenTimer != null )
            //    m_FrozenTimer.Stop();

            //if ( m_AutoManifestTimer != null )
            //    m_AutoManifestTimer.Stop();
        }

        /// <summary>
        /// 
        /// </summary>
        protected override void ProcessDelta()
        {
            //Mobile m = this;
            //MobileDelta delta;

            //delta = m.m_DeltaFlags;

            //if ( delta == MobileDelta.None )
            //    return;

            //MobileDelta attrs = delta & MobileDelta.Attributes;

            //m.m_DeltaFlags = MobileDelta.None;
            //m.m_InDeltaQueue = false;

            //bool sendHits = false, sendStam = false, sendMana = false, sendAll = false, sendAny = false;
            //bool sendIncoming = false, sendNonlocalIncoming = false;
            //bool sendUpdate = false, sendRemove = false;
            //bool sendPublicStats = false, sendPrivateStats = false;
            //bool sendMoving = false, sendNonlocalMoving = false;
            //bool sendOPLUpdate = Core.AOS && ( delta & MobileDelta.Properties ) != 0;

            //bool sendHair = false, sendFacialHair = false, removeHair = false, removeFacialHair = false;

            //if ( attrs != MobileDelta.None )
            //{
            //    sendAny = true;

            //    if ( attrs == MobileDelta.Attributes )
            //    {
            //        sendAll = true;
            //    }
            //    else
            //    {
            //        sendHits = ( ( attrs & MobileDelta.Hits ) != 0 );
            //        sendStam = ( ( attrs & MobileDelta.Stam ) != 0 );
            //        sendMana = ( ( attrs & MobileDelta.Mana ) != 0 );
            //    }
            //}

            //if ( ( delta & MobileDelta.GhostUpdate ) != 0 )
            //{
            //    sendNonlocalIncoming = true;
            //}

            //if ( ( delta & MobileDelta.Hue ) != 0 )
            //{
            //    sendNonlocalIncoming = true;
            //    sendUpdate = true;
            //    sendRemove = true;
            //}

            //if ( ( delta & MobileDelta.Direction ) != 0 )
            //{
            //    sendNonlocalMoving = true;
            //    sendUpdate = true;
            //}

            //if ( ( delta & MobileDelta.Body ) != 0 )
            //{
            //    sendUpdate = true;
            //    sendIncoming = true;
            //}

            ///*if ( (delta & MobileDelta.Hue) != 0 )
            //    {
            //        sendNonlocalIncoming = true;
            //        sendUpdate = true;
            //    }
            //    else if ( (delta & (MobileDelta.Direction | MobileDelta.Body)) != 0 )
            //    {
            //        sendNonlocalMoving = true;
            //        sendUpdate = true;
            //    }
            //    else*/
            //if ( ( delta & ( MobileDelta.Flags | MobileDelta.Noto ) ) != 0 )
            //{
            //    sendMoving = true;
            //}

            //if ( ( delta & MobileDelta.Name ) != 0 )
            //{
            //    sendAll = false;
            //    sendHits = false;
            //    sendAny = sendStam || sendMana;
            //    sendPublicStats = true;
            //}

            //if ( ( delta & ( MobileDelta.WeaponDamage | MobileDelta.Resistances | MobileDelta.Stat | MobileDelta.Weight | MobileDelta.Gold | MobileDelta.Armor | MobileDelta.StatCap | MobileDelta.Followers | MobileDelta.TithingPoints | MobileDelta.Race ) ) != 0 )
            //{
            //    sendPrivateStats = true;
            //}

            //if ( ( delta & MobileDelta.Hair ) != 0 )
            //{
            //    if ( m.HairItemID <= 0 )
            //        removeHair = true;

            //    sendHair = true;
            //}

            //if ( ( delta & MobileDelta.FacialHair ) != 0 )
            //{
            //    if ( m.FacialHairItemID <= 0 )
            //        removeFacialHair = true;

            //    sendFacialHair = true;
            //}

            //Packet[] cache = m_MovingPacketCache;

            //if ( sendMoving || sendNonlocalMoving )
            //{
            //    for ( int i = 0; i < cache.Length; ++i )
            //        Packet.Release( ref cache[i] );
            //}

            //NetState ourState = m.m_NetState;

            //if ( ourState != null )
            //{
            //    if ( sendUpdate )
            //    {
            //        ourState.Sequence = 0;
            //        ourState.Send( new MobileUpdate( m ) );
            //        ClearFastwalkStack();
            //    }

            //    if ( sendIncoming )
            //        ourState.Send( new MobileIncoming( m, m ) );

            //    if ( sendMoving )
            //    {
            //        int noto = Notoriety.Compute( m, m );
            //        ourState.Send( cache[noto] = Packet.Acquire( new MobileMoving( m, noto ) ) );
            //    }

            //    if ( sendPublicStats || sendPrivateStats )
            //    {
            //        ourState.Send( new MobileStatusExtended( m ) );
            //    }
            //    else if ( sendAll )
            //    {
            //        ourState.Send( new MobileAttributes( m ) );
            //    }
            //    else if ( sendAny )
            //    {
            //        if ( sendHits )
            //            ourState.Send( new MobileHits( m ) );

            //        if ( sendStam )
            //            ourState.Send( new MobileStam( m ) );

            //        if ( sendMana )
            //            ourState.Send( new MobileMana( m ) );
            //    }

            //    if ( sendStam || sendMana )
            //    {
            //        IParty ip = m_Party as IParty;

            //        if ( ip != null && sendStam )
            //            ip.OnStamChanged( this );

            //        if ( ip != null && sendMana )
            //            ip.OnManaChanged( this );
            //    }

            //    if ( sendHair )
            //    {
            //        if ( removeHair )
            //            ourState.Send( new RemoveHair( m ) );
            //        else
            //            ourState.Send( new HairEquipUpdate( m ) );
            //    }

            //    if ( sendFacialHair )
            //    {
            //        if ( removeFacialHair )
            //            ourState.Send( new RemoveFacialHair( m ) );
            //        else
            //            ourState.Send( new FacialHairEquipUpdate( m ) );
            //    }

            //    if ( sendOPLUpdate )
            //        ourState.Send( OPLPacket );
            //}

            //sendMoving = sendMoving || sendNonlocalMoving;
            //sendIncoming = sendIncoming || sendNonlocalIncoming;
            //sendHits = sendHits || sendAll;

            //if ( m.m_Map != null && ( sendRemove || sendIncoming || sendPublicStats || sendHits || sendMoving || sendOPLUpdate || sendHair || sendFacialHair ) )
            //{
            //    Mobile beholder;

            //    IPooledEnumerable eable = m.Map.GetClientsInRange( m.m_Location );

            //    Packet hitsPacket = null;
            //    Packet statPacketTrue = null, statPacketFalse = null;
            //    Packet deadPacket = null;
            //    Packet hairPacket = null, facialhairPacket = null;

            //    foreach ( NetState state in eable )
            //    {
            //        beholder = state.Mobile;

            //        if ( beholder != m && beholder.CanSee( m ) )
            //        {
            //            if ( sendRemove )
            //                state.Send( m.RemovePacket );

            //            if ( sendIncoming )
            //            {
            //                state.Send( new MobileIncoming( beholder, m ) );

            //                if ( m.IsDeadBondedPet )
            //                {
            //                    if ( deadPacket == null )
            //                        deadPacket = Packet.Acquire( new BondedStatus( 0, m.m_Serial, 1 ) );

            //                    state.Send( deadPacket );
            //                }
            //            }

            //            if ( sendMoving )
            //            {
            //                int noto = Notoriety.Compute( beholder, m );

            //                Packet p = cache[noto];

            //                if ( p == null )
            //                    cache[noto] = p = Packet.Acquire( new MobileMoving( m, noto ) );

            //                state.Send( p );
            //            }

            //            if ( sendPublicStats )
            //            {
            //                if ( m.CanBeRenamedBy( beholder ) )
            //                {
            //                    if ( statPacketTrue == null )
            //                        statPacketTrue = Packet.Acquire( new MobileStatusCompact( true, m ) );

            //                    state.Send( statPacketTrue );
            //                }
            //                else
            //                {
            //                    if ( statPacketFalse == null )
            //                        statPacketFalse = Packet.Acquire( new MobileStatusCompact( false, m ) );

            //                    state.Send( statPacketFalse );
            //                }
            //            }
            //            else if ( sendHits )
            //            {
            //                if ( hitsPacket == null )
            //                    hitsPacket = Packet.Acquire( new MobileHitsN( m ) );

            //                state.Send( hitsPacket );
            //            }

            //            if ( sendHair )
            //            {
            //                if ( hairPacket == null )
            //                {
            //                    if ( removeHair )
            //                        hairPacket = Packet.Acquire( new RemoveHair( m ) );
            //                    else
            //                        hairPacket = Packet.Acquire( new HairEquipUpdate( m ) );
            //                }

            //                state.Send( hairPacket );
            //            }

            //            if ( sendFacialHair )
            //            {
            //                if ( facialhairPacket == null )
            //                {
            //                    if ( removeFacialHair )
            //                        facialhairPacket = Packet.Acquire( new RemoveFacialHair( m ) );
            //                    else
            //                        facialhairPacket = Packet.Acquire( new FacialHairEquipUpdate( m ) );
            //                }

            //                state.Send( facialhairPacket );
            //            }

            //            if ( sendOPLUpdate )
            //                state.Send( OPLPacket );
            //        }
            //    }

            //    Packet.Release( hitsPacket );
            //    Packet.Release( statPacketTrue );
            //    Packet.Release( statPacketFalse );
            //    Packet.Release( deadPacket );
            //    Packet.Release( hairPacket );
            //    Packet.Release( facialhairPacket );

            //    eable.Free();
            //}

            //if ( sendMoving || sendNonlocalMoving )
            //{
            //    for ( int i = 0; i < cache.Length; ++i )
            //        Packet.Release( ref cache[i] );
            //}
        }
        #endregion











        #region zh-CHS 人物的种族 | en

        #region zh-CHS 私有成员变量 | en Private Member Variables
        //private int m_ItemID;
        //private Layer m_Layer;
        //private object m_Parent; // BaseMobile, BaseItem, or null=World
        //private LootType m_LootType;
        //internal int m_TypeRef;

        //private Body m_Body;
        //private Poison m_Poison;
        //private TimeSlice m_PoisonTimer;
        //private BaseGuild m_Guild;
        //private string m_GuildTitle;
        //private bool m_Criminal;
        //private int m_Kills, m_ShortTermMurders;
        //private int m_SpeechHue, m_EmoteHue, m_WhisperHue, m_YellHue;
        //private string m_Language;
        //private bool m_Female;
        //private bool m_Warmode;
        private bool  m_Blessed = false;
        //private int m_StatCap;
        //private int m_Fame, m_Karma;
        //private ISpell m_Spell;
        //private Target m_Target;
        //private Prompt m_Prompt;
        //private ContextMenu m_ContextMenu;
        //private List<BaseMobile> m_Stabled;
        //private bool m_Meditating;
        //private bool m_CanHearGhosts;
        //private bool m_CanSwim;
        //private bool m_CantWalk;
        //private bool m_DisplayGuildTitle;
        //private BaseMobile m_GuildFealty;
        //private TimeSlice m_ExpireCombatant;
        //private TimeSlice m_ExpireCriminal;
        //private TimeSlice m_LogoutTimer;
        //private TimeSlice m_CombatTimer;
        //private Region m_Region;
        //private int m_Followers, m_FollowersMax;
        private ArrayList m_Actions;
        //private Queue<MovementRecord> m_MoveRecords;
        //private int m_WarmodeChanges = 0;
        //private DateTime m_NextWarmodeChange;
        //private WarmodeTimer m_WarmodeTimer;
        //private VirtueInfo m_Virtues;
        //private object m_Party;
        //private Body m_BodyMod;
        //private DateTime m_LastStrGain;
        //private DateTime m_LastIntGain;
        //private DateTime m_LastDexGain;
        /* Logout:
        * 
        * When a client logs into mobile x
        *  - if ( x is Internalized ) move x to logout location and map
        * 
        * When a client attached to a mobile disconnects
        *  - LogoutTimer is started
        *	   - Delay is taken from Region.GetLogoutDelay to allow insta-logout regions.
        *     - OnTick : Location and map are stored, and mobile is internalized
        * 
        * Some things to consider:
        *  - An internalized person getting killed (say, by poison). Where does the body go?
        *  - Regions now have a GetLogoutDelay( BaseMobile m ); virtual function (see above)
        */
        /// <summary>
        /// 人物最后退出的位置点
        /// </summary>
        //private Point3D m_LogoutLocation;
        /// <summary>
        /// 人物最后退出的地图位置点
        /// </summary>
        //private BaseMap m_LogoutMap;

        #endregion

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的种族
        /// </summary>
        private BaseRace m_Race;
        #endregion
        /// <summary>
        /// 人物的种族
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public BaseRace Race
        {
            get { return m_Race; }
            set
            {
                if ( m_Race == value )
                    return;

                BaseRace oldRace = m_Race;
                m_Race = value;

                // 更新抗性
                //UpdateResistances();
                // 种族的修改-Delta
                //Delta( MobileDelta.Race );
                // 种族已修改
                OnRaceChange( oldRace );
            }
        }

        /// <summary>
        /// 人物种族的技能奖励
        /// </summary>
        public virtual double RacialSkillBonus
        {
            get { return 0; }
        }
        #endregion

        #region zh-CHS 人物的种族 | en
        /// <summary>
        /// 人物种族改变
        /// </summary>
        /// <param name="oldRace"></param>
        protected internal virtual void OnRaceChange( BaseRace oldRace )
        {
        }
        #endregion

        #region zh-CHS 人物的AI | en

        #region zh-CHS 人物的技能属性 | en
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的技能总数
        /// </summary>
        private Skills m_Skills = null;
        #endregion
        /// <summary>
        /// 技能
        /// </summary>
        [CommandProperty( AccessLevel.Counselor )]
        public Skills Skills
        {
            get { return m_Skills; }
            set { }
        }

        /// <summary>
        /// 人物的技能总数
        /// </summary>
        [CommandProperty( AccessLevel.GameMaster )]
        public int SkillsTotal
        {
            get { return m_Skills == null ? 0 : m_Skills.Total; }
        }

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 人物的技能模块
        /// </summary>
        private List<SkillMod> m_SkillMods = new List<SkillMod>();
        #endregion
        /// <summary>
        /// 人物的技能模块列表
        /// </summary>
        public List<SkillMod> SkillMods
        {
            get { return m_SkillMods; }
        }
        #endregion

        #region zh-CHS 人物的普通(攻击/防御) | en
        /// <summary>
        /// 伤害
        /// </summary>
        /// <param name="amount"></param>
        public virtual void Damage( int amount )
        {
            Damage( amount, null );
        }

        /// <summary>
        /// 是否能够伤害
        /// </summary>
        /// <returns></returns>
        public virtual bool CanBeDamaged()
        {
            return !m_Blessed;
        }

        /// <summary>
        /// 伤害
        /// </summary>
        /// <param name="amount"></param>
        /// <param name="from"></param>
        public virtual void Damage( int amount, BaseCreature from )
        {
            Damage( amount, from, true );
        }

        /// <summary>
        /// 伤害
        /// </summary>
        /// <param name="amount"></param>
        /// <param name="from"></param>
        /// <param name="informMount"></param>
        public virtual void Damage( int amount, BaseCreature from, bool informMount )
        {
            //if( !CanBeDamaged() || m_Deleted )
            //    return;

            //if( !this.Region.OnDamage( this, ref amount ) )
            //    return;

            //if( amount > 0 )
            //{
            //    int oldHits = Hits;
            //    int newHits = oldHits - amount;

            //    if( m_Spell != null )
            //        m_Spell.OnCasterHurt();

            //    //if ( m_Spell != null && m_Spell.State == SpellState.Casting )
            //    //	m_Spell.Disturb( DisturbType.Hurt, false, true );

            //    if( from != null )
            //        RegisterDamage( amount, from );

            //    DisruptiveAction();

            //    Paralyzed = false;

            //    switch( m_VisibleDamageType )
            //    {
            //        case VisibleDamageType.Related:
            //            {
            //                NetState ourState = m_NetState, theirState = (from == null ? null : from.m_NetState);

            //                if( ourState == null )
            //                {
            //                    BaseMobile master = GetDamageMaster( from );

            //                    if( master != null )
            //                        ourState = master.m_NetState;
            //                }

            //                if( theirState == null && from != null )
            //                {
            //                    BaseMobile master = from.GetDamageMaster( this );

            //                    if( master != null )
            //                        theirState = master.m_NetState;
            //                }

            //                if( amount > 0 && (ourState != null || theirState != null) )
            //                {
            //                    Packet p = null;// = new DamagePacket( this, amount );

            //                    if( ourState != null )
            //                    {
            //                        bool newPacket = (ourState.Version != null && ourState.Version >= DamagePacket.Version);

            //                        if( newPacket )
            //                            p = Packet.Acquire( new DamagePacket( this, amount ) );
            //                        else
            //                            p = Packet.Acquire( new DamagePacketOld( this, amount ) );

            //                        ourState.Send( p );
            //                    }

            //                    if( theirState != null && theirState != ourState )
            //                    {
            //                        bool newPacket = (theirState.Version != null && theirState.Version >= DamagePacket.Version);

            //                        if( newPacket && (p == null || !(p is DamagePacket)) )
            //                        {
            //                            Packet.Release( p );
            //                            p = Packet.Acquire( new DamagePacket( this, amount ) );
            //                        }
            //                        else if( !newPacket && (p == null || !(p is DamagePacketOld)) )
            //                        {
            //                            Packet.Release( p );
            //                            p = Packet.Acquire( new DamagePacketOld( this, amount ) );
            //                        }

            //                        theirState.Send( p );
            //                    }

            //                    Packet.Release( p );
            //                }

            //                break;
            //            }
            //        case VisibleDamageType.Everyone:
            //            {
            //                SendDamageToAll( amount );
            //                break;
            //            }
            //    }

            //    OnDamage( amount, from, newHits < 0 );

            //    IMount m = this.Mount;
            //    if( m != null && informMount )
            //        m.OnRiderDamaged( amount, from, newHits < 0 );

            //    if( newHits < 0 )
            //    {
            //        m_LastKiller = from;

            //        Hits = 0;

            //        if( oldHits >= 0 )
            //            Kill();
            //    }
            //    else
            //    {
            //        Hits = newHits;
            //    }
            //}
        }

        /// <summary>
        /// 发送全部的伤害
        /// </summary>
        /// <param name="amount"></param>
        public virtual void SendDamageToAll( int amount )
        {
            //if( amount < 0 )
            //    return;

            //BaseMap map = m_Map;

            //if( map == null )
            //    return;

            //IPooledEnumerable eable = map.GetClientsInRange( m_Location );

            //Packet pNew = null;
            //Packet pOld = null;

            //foreach( NetState ns in eable )
            //{
            //    if( ns.BaseMobile.CanSee( this ) )
            //    {
            //        bool newPacket = (ns.Version != null && ns.Version >= DamagePacket.Version);
            //        Packet p;

            //        if( newPacket )
            //        {
            //            if( pNew == null )
            //                pNew = Packet.Acquire( new DamagePacket( this, amount ) );

            //            p = pNew;
            //        }
            //        else
            //        {
            //            if( pOld == null )
            //                pOld = Packet.Acquire( new DamagePacketOld( this, amount ) );

            //            p = pOld;
            //        }

            //        ns.Send( p );
            //    }
            //}

            //Packet.Release( pNew );
            //Packet.Release( pOld );

            //eable.Free();
        }

        /// <summary>
        /// 治疗
        /// </summary>
        /// <param name="amount"></param>
        public void Heal( int amount )
        {
            Heal( amount, true );
        }

        /// <summary>
        /// 治疗
        /// </summary>
        /// <param name="amount"></param>
        /// <param name="message"></param>
        public void Heal( int amount, bool message )
        {
            //if( !Alive || IsDeadBondedPet )
            //    return;

            //if ( !Region.OnHeal( this, ref amount ) )
            //    return;

            //if ( ( Hits + amount ) > HitsMax )
            //{
            //    amount = HitsMax - Hits;
            //}

            //Hits += amount;

            //if( message && amount > 0 && m_NetState != null )
            //    m_NetState.Send( new MessageLocalizedAffix( Serial.MinusOne, -1, MessageType.Label, 0x3B2, 3, 1008158, "", AffixType.Append | AffixType.System, amount.ToString(), "" ) );
        }

        #endregion

        #region zh-CHS 人物的技能(攻击/增益/诅咒) | en
        /// <summary>
        /// 
        /// </summary>
        /// <param name="skill"></param>
        /// <param name="minSkill"></param>
        /// <param name="maxSkill"></param>
        /// <returns></returns>
        public bool CheckSkill( SkillName skill, double minSkill, double maxSkill )
        {
            //if ( m_SkillCheckLocationHandler == null )
            return false;
            //else
            //    return m_SkillCheckLocationHandler( this, skill, minSkill, maxSkill );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="skill"></param>
        /// <param name="chance"></param>
        /// <returns></returns>
        public bool CheckSkill( SkillName skill, double chance )
        {
            //if ( m_SkillCheckDirectLocationHandler == null )
            return false;
            //else
            //    return m_SkillCheckDirectLocationHandler( this, skill, chance );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="skill"></param>
        /// <param name="target"></param>
        /// <param name="minSkill"></param>
        /// <param name="maxSkill"></param>
        /// <returns></returns>
        public bool CheckTargetSkill( SkillName skill, object target, double minSkill, double maxSkill )
        {
            //if ( m_SkillCheckTargetHandler == null )
            return false;
            //else
            //    return m_SkillCheckTargetHandler( this, skill, target, minSkill, maxSkill );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="skill"></param>
        /// <param name="target"></param>
        /// <param name="chance"></param>
        /// <returns></returns>
        public bool CheckTargetSkill( SkillName skill, object target, double chance )
        {
            //if ( m_SkillCheckDirectTargetHandler == null )
            return false;
            //else
            //    return m_SkillCheckDirectTargetHandler( this, skill, target, chance );
        }


        /// <summary>
        /// 技能无效时
        /// </summary>
        /// <param name="skill"></param>
        public virtual void OnSkillInvalidated( BaseSkill skill )
        {
        }

        /// <summary>
        /// 更新技能模块
        /// </summary>
        public virtual void UpdateSkillMods()
        {
            //ValidateSkillMods();

            //for ( int i = 0; i < m_SkillMods.Count; ++i )
            //{
            //    SkillMod mod = m_SkillMods[i];

            //    Skill sk = m_Skills[mod.Skill];

            //    if ( sk != null )
            //        sk.Update();
            //}
        }

        /// <summary>
        /// 确认技能模块
        /// </summary>
        public virtual void ValidateSkillMods()
        {
            //for ( int i = 0; i < m_SkillMods.Count; )
            //{
            //    SkillMod mod = m_SkillMods[i];

            //    if ( mod.CheckCondition() )
            //        ++i;
            //    else
            //        InternalRemoveSkillMod( mod );
            //}
        }

        /// <summary>
        /// 添加技能模块
        /// </summary>
        /// <param name="mod"></param>
        public virtual void AddSkillMod( SkillMod mod )
        {
            //if ( mod == null )
            //    return;

            //ValidateSkillMods();

            //if ( !m_SkillMods.Contains( mod ) )
            //{
            //    m_SkillMods.Add( mod );
            //    mod.Owner = this;

            //    Skill sk = m_Skills[mod.Skill];

            //    if ( sk != null )
            //        sk.Update();
            //}
        }

        /// <summary>
        /// 移去技能模块
        /// </summary>
        /// <param name="mod"></param>
        public virtual void RemoveSkillMod( SkillMod mod )
        {
            //if ( mod == null )
            //    return;

            //ValidateSkillMods();

            //InternalRemoveSkillMod( mod );
        }

        /// <summary>
        /// 内部移去技能模块
        /// </summary>
        /// <param name="mod"></param>
        private void InternalRemoveSkillMod( SkillMod mod )
        {
            //if ( m_SkillMods.Contains( mod ) )
            //{
            //    m_SkillMods.Remove( mod );
            //    mod.Owner = null;

            //    Skill sk = m_Skills[mod.Skill];

            //    if ( sk != null )
            //        sk.Update();
            //}
        }


        /// <summary>
        /// 发送技能消息
        /// </summary>
        public virtual void SendSkillMessage()
        {
            if ( DateTime.Now < m_NextActionMessage )
                return;

            m_NextActionMessage = DateTime.Now + m_ActionMessageDelay;

        }

        /// <summary>
        /// 发送动作消息
        /// </summary>
        public virtual void SendActionMessage()
        {
            if ( DateTime.Now < m_NextActionMessage )
                return;

            m_NextActionMessage = DateTime.Now + m_ActionMessageDelay;

        }


        /// <summary>
        /// 技能改变
        /// </summary>
        /// <param name="skill"></param>
        /// <param name="oldBase"></param>
        public virtual void OnSkillChange( SkillName skill, double oldBase )
        {
        }

        /// <summary>
        /// 是否允许使用技能
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public virtual bool AllowSkillUse( SkillName name )
        {
            return true;
        }

        /// <summary>
        /// 是否允许使用技能
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public virtual bool UseSkill( SkillName name )
        {
            return true;
            //return m_Skills.UseSkill( this, name );
        }

        /// <summary>
        /// 是否允许使用技能
        /// </summary>
        /// <param name="skillID"></param>
        /// <returns></returns>
        public virtual bool UseSkill( int skillID )
        {
            return true;
            //return m_Skills.UseSkill( this, skillID );
        }
        #endregion

        #region zh-CHS 人物的魔法(攻击/增益/诅咒) | en
        /// <summary>
        /// 检查符咒
        /// </summary>
        /// <param name="spell"></param>
        /// <returns></returns>
        public virtual bool CheckSpellCast( ISpell spell )
        {
            return true;
        }

        /// <summary>
        /// 在符咒
        /// </summary>
        /// <param name="spell"></param>
        public virtual void OnSpellCast( ISpell spell )
        {
        }
        #endregion

        #endregion

        /// <summary>
        /// 开始动作(指示某个魔法或技能将开始使用在此人物身上)
        /// </summary>
        /// <param name="toLock"></param>
        /// <returns></returns>
        public bool BeginAction( object toLock )
        {
            if ( m_Actions == null )
            {
                m_Actions = new ArrayList( 2 );

                m_Actions.Add( toLock );

                return true;
            }
            else if ( !m_Actions.Contains( toLock ) )
            {
                m_Actions.Add( toLock );

                return true;
            }

            return false;
        }

        /// <summary>
        /// 是否可以开始动作(指示某个魔法或技能已经是否已使用在此人物身上)
        /// </summary>
        /// <param name="toLock"></param>
        /// <returns></returns>
        public bool CanBeginAction( object toLock )
        {
            return ( m_Actions == null || !m_Actions.Contains( toLock ) );
        }

        /// <summary>
        /// 结束动作(指示某个魔法或技能以结束使用在此人物身上)
        /// </summary>
        /// <param name="toLock"></param>
        public void EndAction( object toLock )
        {
            if ( m_Actions != null )
            {
                m_Actions.Remove( toLock );

                if ( m_Actions.Count == 0 )
                    m_Actions = null;
            }
        }

        /// <summary>
        /// 完成计算人物移动的数据
        /// </summary>
        /// <returns></returns>
        //public TimeSpan ComputeMovementSpeed()
        //{
        //    return ComputeMovementSpeed( this.Direction, false );
        //}

        /// <summary>
        /// 完成计算人物移动的数据
        /// </summary>
        /// <param name="dir"></param>
        /// <returns></returns>
        public TimeSpan ComputeMovementSpeed( Direction direction )
        {
            return ComputeMovementSpeed( direction, true );
        }

        /// <summary>
        /// 完成计算人物移动的数据
        /// </summary>
        /// <param name="dir"></param>
        /// <param name="checkTurning"></param>
        /// <returns></returns>
        public virtual TimeSpan ComputeMovementSpeed( Direction dir, bool checkTurning )
        {
            TimeSpan delay = new TimeSpan( 1 );

            //if ( Mounted )
            //    delay = ( dir & Direction.Running ) != 0 ? m_RunMount : m_WalkMount;
            //else
            //    delay = ( dir & Direction.Running ) != 0 ? m_RunFoot : m_WalkFoot;

            return delay;
        }
    }
}

